import request from '@/utils/request'

// 查询预案列表
export function listPlan(query) {
  return request({
    url: '/event/manager/plan/list',
    method: 'get',
    params: query
  })
}

// 查询预案详细
export function getPlan(id) {
  return request({
    url: '/event/manager/plan/' + id,
    method: 'get'
  })
}

// 新增预案
export function addPlan(data) {
  return request({
    url: '/event/manager/plan',
    method: 'post',
    data: data
  })
}

// 修改预案
export function updatePlan(data) {
  return request({
    url: '/event/manager/plan',
    method: 'put',
    data: data
  })
}

// 删除预案
export function delPlan(id) {
  return request({
    url: '/event/manager/plan/' + id,
    method: 'delete'
  })
}

// 导出预案
export function exportPlan(query) {
  return request({
    url: '/event/manager/plan/export',
    method: 'get',
    params: query
  })
}

// 获取获取预案等级
export function exPlanGrade(id) {
  return request({
    url: '/event/manager/plan/getPlanDetails/' + id,
    method: 'get',
  })
}


// 获取预案信息
export function getPlantext(data) {
  return request({
    url: '/event/manager/plan/getPlanContent',
    method: 'post',
    data: { planDetailsId: data }
  })
}

// 提交预案信息
export function putPlantext(data) {
  return request({
    url: '/event/manager/plan/addPlanContent',
    method: 'post',
    data: data
  })
}

// 删除外层
export function deleteplan(id) {
  return request({
    url: '/event/manager/plan/deletePlanContentById/' + id,
    method: 'get',
  })
}

// 删除外层
export function deleteplanlayer(id) {
  return request({
    url: '/event/manager/plan/deleteStepDetailsById/' + id,
    method: 'get',
  })
}

// 事件
export function eventList() {
  return request({
    url: '/event/manager/exigencyEvent/getEventAll',
    method: 'get',
  })
}

// 
// 获取标签
export function gettagList() {
  return request({
    url: '/event/manager/tag/findAll',
    method: 'get',
  })
}